package com.bravo.recruit.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.bravo.recruit.entity.Recruit;

import java.util.List;

/**
 * recruit数据访问接口
 * @author Yuyong
 *
 */
public interface RecruitRepository extends JpaRepository<Recruit,String>,JpaSpecificationExecutor<Recruit>{

    /**
     * 查询最新职位列表（按创建日期降序排序）
     * @param state
     * @return
     */
    List<Recruit> findTop4ByStateOrderByCreateTimeDesc(String state);

    /**
     * 查询职位列表
     * @param state
     * @return
     */
    List<Recruit> findTop12ByStateNotOrderByCreateTimeDesc(String state);

}
